#include "TestMonitorThreadPool.h"
#include "TestLogPlugin.h"



/********************************************************************************
 * @name function TestLogPluginPro
 * @function description：
 * @param
 * @param
 * @param
 * @return
********************************************************************************/
void TestLogPluginPro(QUEUEMSG msg)
{
    /*

    MonitorRequest * request = NULL;

    if(MonitorService::Instance()->getReciveMsg(request))
    {
        return;
    }

    if(NULL == request) return;

    TestMonitorThreadPool::Instance()->DoEventHandler(request);
    */

}

TestMonitorThreadPool * TestMonitorThreadPool::m_pInstance = NULL;
/********************************************************************************
 * @name function TestMonitorThreadPool::Instance
 * @function description：
 * @param
 * @param
 * @param
 * @return
********************************************************************************/
TestMonitorThreadPool * TestMonitorThreadPool::Instance()
{
    if(m_pInstance == NULL)
        m_pInstance = new TestMonitorThreadPool;
    return m_pInstance;
}

/********************************************************************************
 * @name function TestMonitorThreadPool::TestMonitorThreadPool
 * @function description：
 * @param
 * @param
 * @param
 * @return
********************************************************************************/
TestMonitorThreadPool::TestMonitorThreadPool()
{

}

/********************************************************************************
 * @name function TestMonitorThreadPool::DoEventHandler
 * @function description：
 * @param
 * @param
 * @param
 * @return
********************************************************************************/
/*
void TestMonitorThreadPool::DoEventHandler(MonitorRequest * request)
{
    char * uri = NULL;
    request->GetRequestURI(&uri);
    if(uri == NULL)
    {
        return;
    }

    cms_os_mutex_wrapper wrapper(m_mutex);
    IMonitorInvokeMsgHandler * handler = NULL;
//    handler = MonitorService::Instance()->getHandlerByUrl(uri);

    if(handler == NULL) return;

   // handler->OnMsgCall(request, MonitorService::Instance());
}
*/


/********************************************************************************
 * @name function TestMonitorThreadPool::init
 * @function description：
 * @param
 * @param
 * @param
 * @return
********************************************************************************/
void TestMonitorThreadPool::init()
{
    m_mutex = cms_os_mutex_create();

    m_threadPool = CreateBankPool(4,1024,TestLogPluginPro,NULL);
}

/********************************************************************************
 * @name function TestMonitorThreadPool::GetThreadPool
 * @function description：
 * @param
 * @param
 * @param
 * @return
********************************************************************************/
IThreadPool * TestMonitorThreadPool::GetThreadPool()
{
    return m_threadPool;
}
